package com.sy.musicapp.ui.splash

import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import com.airbnb.lottie.compose.LottieAnimation
import com.airbnb.lottie.compose.LottieCompositionSpec
import com.airbnb.lottie.compose.animateLottieCompositionAsState
import com.airbnb.lottie.compose.rememberLottieComposition
import com.sy.musicapp.R

/**
 * 开屏动画
 * @author SY
 * @since 2022-03-06 12:01
 **/
@Composable
fun SplashScreen() {
    val composition by
    rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.music_splash))
    val progress by animateLottieCompositionAsState(
        composition = composition,
        speed = 0.4f,
        restartOnPlay = false
    )
    LottieAnimation(composition = composition, progress = progress)
}